Adding Wikipedia-esque templates to pages
-
I know, this might be asking a lot of the blog’s capabilities, but I can handle inserting tables in whole into pages. But I’d like to find out how to do templates like in Wikipedia, here.
Examples:
- https://en.wikipedia.org/wiki/Template:Infobox_video_game
- https://en.wikipedia.org/wiki/Template:Infobox_video_game
The blog I need help with is: (visible only to logged in users)
-
Edit: My bad. Second link was supposed to be this: https://en.wikipedia.org/wiki/Template:Navbox
-
Tables can be inserted into pages or posts here at WordPress.com. A quick look at the links you referenced shows that much of it consists of tables and standard “pre” sections (such as under “Usage”). The table of contents is a standard list.
If you aren’t yet familiar with the web inspector feature in your browser, I would suggest a quick viewing of the screencasts we created to get you started with them. They are very useful for things like this and for doing CSS.
For tables, you can create your own CSS classes and then apply them to individual tables by including a class declaration in the opening table tag such as this:
<table class="my-table-1">
Alternately you can include inline CSS styling within the table element tags such as this:
<table style="width: 100%; background-color: #CC0000;">
I would suggest the first since it keeps you from having to repeat things.
Basic table structures can be created quite quickly and easily by using one of the online HTML table generators such as this one, http://www.tablesgenerator.com/html_tables , which also allows you to merge cells and such. At the top of the code, it includes the basic CSS styling. The CSS it generates has to be put into the CSS rather than inline with the table since you cannot use the style HTML tag within posts or pages here at WordPress.com.
-
Once you have a Post set up the way you want it, you can use the Copy Post function in the editor to keep from needing to copy all the setup stuff. I have used the Copy Post for a Post I am working on that has a lot of Table styling, and it kept me from needing to rebuild the whole table, just change the text in the table.
-
Morning Morning @TSP – you all be welcome – why reinvent the wheel?
The Post I am working on has four tables – each with 288 cells, just changing the content took hours (a math exercise on compass correction) – the original table took some work to get fixed and I needed help from I think Panos and others to get the lines the right weight and such.
-
-
@michaelbishop852, you are welcome, and if you have any problems, don’t beat your head against the monitor for too long. :) We are here to help.
-
-
- The topic ‘Adding Wikipedia-esque templates to pages’ is closed to new replies.