How to center table entries?

+7 votes
206 views
How can I center the data entries in the yDNA table:

{| border=1
| yDNA-12<ref>[http://archive.thorpedna.org/TESTRESULTS.html Test Results]</ref>  || 1 || 2 || 3 ||  4 ||  5 || 6 || 7 || 8 || 9 || 10 || 11 || 12
|-
| markers || 393 || 390 || 19 ||  391 || 385a || 385b || 426 || 388 || 439 || 389-1 || 392 || 389-2
|-
| Thomas Thorpe (1631) || 13 || 23 || 14 ||  12 || 11 || 14 || 12 || 12 || 12 || 13 || 13 || 29
|}<br>

I think it would be easier to read if the data in columns after first column were centered instead of left justified.  How can I center the data by column, or if not by row, center all data in all columns?
WikiTree profile: Thomas Tharp
in WikiTree Tech by William Foster G2G6 Pilot (106k points)

William --

I took a look at your code on the profile, and I wanted to mention that to save yourself a little extra code in the future -- and as RJ mentioned -- you can put the "center" element on the line that starts a new row. For example:

{| class="wikitable" border="1" 
|- align=center
| yDNA-12<ref>Source: [[#S201]]</ref>  || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 ||9 || 10 || 11 || 12
|- align=center
| markers || 393 || 390 || 19 ||  391 || 385a || 385b || 426 || 388 || 439 || 389-1 || 392 || 389-2 
|- align=center
| [[Tharp-306 | Thomas Thorpe (1631)]] || 13 || 23 || 14 ||  12 || 11 || 14 || 12 || 12 || 12 || 13 || 13 || 29
|}

If you enjoy playing around with stuff like this, there's a pretty good help page on Wikipedia here.

Have fun! 

2 Answers

+3 votes
 
Best answer

Or, to align a single cell

... || align=center | content || ...

To do a whole row

|- align=center

 

by Anonymous Horace G2G6 Pilot (568k points)
selected by William Foster
0 votes
One of these should work

Example1.
<style> table {text-align:center;} </style>

Example 2.
<table align="center">
<tr>
<td>
<ul>
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
<li>item 4 - this one is longer</li>
</ul>
</td>
</tr>
</table>

Creating a Template  http://www.wikitree.com/wiki/Creating_a_Template
by David Selman G2G Astronaut (1.1m points)

Related questions

+6 votes
2 answers
131 views asked Sep 29, 2019 in WikiTree Help by SJ Baty G2G Astronaut (1.1m points)
+8 votes
1 answer
38 views asked Mar 20 in Photos by Michael McGuigan G2G6 (7.4k points)
+2 votes
1 answer
84 views asked Nov 11, 2020 in WikiTree Help by Steve McIntire G2G Crew (550 points)
+6 votes
0 answers
36 views asked Sep 9, 2020 in Photos by Tom Pratt G2G1 (1.0k points)

WikiTree  ~  About  ~  Help Help  ~  Search Person Search  ~  Surname:

disclaimer - terms - copyright

...