- This topic has 5 replies, 2 voices, and was last updated 8 years, 2 months ago by Tom.
-
AuthorPosts
-
January 31, 2016 at 4:30 am #169233Jaakko Pöntinen
Hey.
Trying to insert a simple 1-row, 3-column table with 0% padding, 0% margin and 0px borders into the BPH. The content editor keeps editing out tags like <style> so that the style settings show up as text when I preview them on the frontend. Here’s what I write into the content editor of BPH:
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 0px solid black;
padding: 0px;
}
table {
border-spacing: 0px;
}
</style>
</head>
<body><table style=”width:100%”>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
</table>
</body>
</html>Now this is a modified copy from http://www.w3schools.com/html/tryit.asp?filename=tryhtml_table_cellspacing. The modified version works nicely in the tryit editor.
What am I doing wrong? A lot, I think. I’d really need to get my head around the most basic HTML and CSS – I can’t even tell which bit of code is which. But: I am learning, though it feels like I’m climbing the apple tree feet first.
– Jaakko Pöntinen
January 31, 2016 at 4:55 am #169236Jaakko PöntinenOk,
doing research it seems that control over HTML table style has been largely transferred from HTML to CSS. What the heck do I do now, since CSS is not allowed in the BPH content editor?
Now my code looks as follow:
<table width=”100%” cellspacing=”0″ cellpadding=”0″ border=”0″ align=”center” bgcolor=””>
<tr bgcolor=””>
<td width=”33%”></td>
<td width=”34%” align=”right”>[widget id=”slideshowwidget-2″]</td>
<td width=”33%” align=”right”>[widget id=”slideshowwidget-3″]</td>
</tr></table>
This all works, but there’s no controlling the style almost whatsoever. Even the cellspacing, cellpadding etc variables are not accepted because of HTML5, if I’ve understood correctly.
Thanks,
– Jaakko Pöntinen- This reply was modified 8 years, 2 months ago by Jaakko Pöntinen. Reason: Just added some stuff
January 31, 2016 at 5:00 am #169238Jaakko PöntinenI’ve understood that in the world of CSS, anything could be placed anywhere, being relative in position and size to anything (other CSS elements). I want two, maybe three slideshows on my header. I feel like jumping out the window. Just ain’t got the skills and it’s driving me nuts.
Sorry for the rant, it’s not directed at anyone or anything in specific, just to let out steam.
– Jaakko
January 31, 2016 at 9:41 am #169339TomLead DeveloperLead DeveloperYou can give the table a class:
<table class="my-custom-table"...
Then apply specific CSS to it for padding, spacing etc..
However, if you’re wanting to add columns, use our Lightweight Grid Columns plugin: https://wordpress.org/plugins/lightweight-grid-columns/
Tables are meant for tabular data (stats etc..)
January 31, 2016 at 10:50 am #169376Jaakko PöntinenAll I can say is yes, the method you suggested works 100% and is the right thing for this. Gotta love CSS, just have to wrap my head around how to not mess style with content and how to make things so that CSS gets a hold of it. Downloaded the plugin, gave the columns classes and well, CSS’d what I needed. Thanks!
– Jaakko
January 31, 2016 at 11:08 am #169387TomLead DeveloperLead DeveloperPerfect, glad it worked 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.