How to center table entries?

+7 votes
158 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 Mach 8 (86.6k 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

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 G2G6 Pilot (890k points)
+3 votes

Or, to align a single cell

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

To do a whole row

|- align=center

 

by RJ Horace G2G6 Pilot (561k points)

Related questions

+6 votes
2 answers
98 views asked Sep 29, 2019 in WikiTree Help by SJ Baty G2G Astronaut (1m points)
+6 votes
0 answers
21 views asked Sep 9 in Photos by Tom Pratt G2G Crew (650 points)
+3 votes
0 answers
+5 votes
2 answers
+5 votes
0 answers
55 views asked Feb 14, 2019 in The Tree House by Martha Garrett G2G6 Mach 2 (20.5k points)
+4 votes
3 answers
+4 votes
2 answers

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

disclaimer - terms - copyright

...