How to center table entries?

+7 votes
424 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 (128k 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 Living Horace G2G6 Pilot (668k 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.3m points)

Related questions

+6 votes
2 answers
522 views asked Sep 29, 2019 in WikiTree Help by SJ Baty G2G Astronaut (1.2m points)
+5 votes
1 answer
+7 votes
1 answer
+5 votes
1 answer
+8 votes
1 answer

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

disclaimer - terms - copyright

...