TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,970
  • Latest: bynw
Stats
  • Total Posts: 196,058
  • Total Topics: 21,338
  • Online today: 234
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online

Fixed width in articles?

Started by MinatO, February 10, 2012, 02:51:09 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MinatO

Hi

I was wondering if there's a fixed width by tp in articles?

I'm having the following problem:
I made brackets for a tournament im organising with tables in html/css, with my original code it fits perfectly. But when I add the code in an article, the width will dissapear and the layout of the brackets and such are being readjusted.

This is the article page:
http://cybersport.co.uk/index.php?page=6

For example if this is the beginning of td code:
<div id="table">
<table width="685">


The width code will dissapear once i save the article, and instead there will be just <table>

Any suggestions on how to solve this?

WillyP

Use css instead. Add this to your css file:

#table table{
width :685px;
}

MinatO

Ok thanks, that worked.

How does it work for seperate cells in css? (having the same problem there)
Since I was trying to set a width for the cells, but same as with the table in general, the code dissapears in the editor from tp.

I'd say:

td {
width: 50px;
}


But then all my cells would change in any page I used, and if I "class" it specifically, I'd use this as html code:
<td class="test">&nbsp;</td>

Then this should be my css code when classed, right?
.test {
width:50px;
}


That however doesn't work for me.

IchBin

I'd have to see the page where you say it's not working for you. But with your assumption about how the class="test" should work is right. But if there could be some other class or something overriding what you are doing. If you haven't taken a look at firebug for firefox, I'd highly recommend it. This tools saves tons of time for troubleshooting these types of issues.

MinatO

Quote from: IchBinâ,,¢ on February 10, 2012, 08:35:16 PM
I'd have to see the page where you say it's not working for you. But with your assumption about how the class="test" should work is right. But if there could be some other class or something overriding what you are doing. If you haven't taken a look at firebug for firefox, I'd highly recommend it. This tools saves tons of time for troubleshooting these types of issues.
Indeed that's what i've been thinking, something is overriding the class.

I'll try to explain how i've made the brackets, I don't expect you to take a deep look into this as i'm sure you're a busy man, but if you have some spare time, feel free to give it a look:

So basicly I used tables to make the brackets, and the lines to connect the boxes aka "td's" I drew with Photoshop and added them as background of the cell.

Here's how it should look like (don't pay attention to the gray background from the lines, its for my tp theme):
http://cybersport.co.uk/5vs5brackets.html

Here's how it looks like in an article atm:
http://cybersport.co.uk/index.php?page=3

Here's my css code related to this page only:
td {
border:0px solid black;
}
#table table{
width :685px;
}
.hyp1, .hyp2, .hyp3, .kk1, .tdw1, .tdw2, .tt1, .ef1, .ef2, .ef3, .ef4, .ef5, .ca1, .vm1, .vm2, .kk2, .ef6, .tt2, .tt3, .ca2, .pen  {
border:1px solid black;
background-color:#77a3cf;
text-align:center;
font-family:Verdana, Geneva, sans-serif
}
.dpen {
border:1px solid black;
background-color:#4d6379;
text-align:center;
font-family:Verdana, Geneva, sans-serif
}
.spen {
border:1px solid black;
background-color:#386b9d;
text-align:center;
font-family:Verdana, Geneva, sans-serif
}
.vs1 {
text-align:right
}
.head1, .head2, .head3 {
border:1px solid black;
background-color:#6483a1;
text-align:center;
font-family:Verdana, Geneva, sans-serif;
font-size:25px;
}


Short explanation of each css tag:
hyp, tt, ef, ... = class of each bracket
dpen= the darkblue row of the standings
spen= the greyish column of the standings
vs= simply the versus text between the brackets
head1, head2 = the "header" of the winners and loser bracket

IchBin

Where's your classes you assigned to your TD's? I don't see that you've put any classes on the <td> tags that you want to change the width of. Using Firebug here at home I added the class to your td and then set the width in the css file and it worked just fine on your table. If you get your changes up and their not working, show me the page with the changes so I can see the problem.

MinatO

Quote from: IchBinâ,,¢ on February 10, 2012, 11:22:25 PM
Where's your classes you assigned to your TD's? I don't see that you've put any classes on the <td> tags that you want to change the width of. Using Firebug here at home I added the class to your td and then set the width in the css file and it worked just fine on your table. If you get your changes up and their not working, show me the page with the changes so I can see the problem.
Yes sorry, that's cause I didn't send u the code where my classes didn't work.

However, i've followed your advice, installed the firebug. And it works now with the classes, I think the problem yesterday was the headers I had in the tables which were causing problems for the widths of individual cells.

I managed to fix it though thanks to firebug, the result is this now:
http://cybersport.co.uk/index.php?page=3

Thanks once again :)

WillyP

That's a fine looking page you got there, congratulations. And you will soon come to think of Firebug as indispensable.

Edit: I edited your first post to mark this as solved. If that is incorrect, feel free to change it again, and let us know what the issue is.

This website is proudly hosted on Crocweb Cloud Website Hosting.