Saturday, June 1, 2024
 Popular · Latest · Hot · Upcoming
29
rated 0 times [  31] [ 2]  / answers: 1 / hits: 30726  / 11 Years ago, fri, july 19, 2013, 12:00:00

I have a problem with a certain tag, grabbed from an external source. This code you will see is taken from another website, and you could also see a date (ex. 15 Juli Måndag) There is dates all over the page, how could I center them with just CSS? Tried with absolute positioning, which leads to have all dates over each other.



Fiddle here.



My html:



    <div id=header>
<div class=schema>
<h1>Schema</h1>
</div>
<div class=back><a id=back href=index.html></a>
</div>
</div>
<div id=content>
<div class=content style=margin-top:0px;>
<div class=article style=text-align:center;>
<!-- Här skrivs det ut en massa saker -->
</div>
</div>
</div>


My JS:



$(window).load(function () { //Fade
$(#status).fadeOut();
$(#preloader).delay(350).fadeOut(slow);
})
grabShedule();

function grabShedule() {
var url = http://1life.se/scraper/Schedule.php; //URL
$.getJSON(url, function (response) {
var html = response.scraped[0].html; //Answer
$('.article').append(html); //Answer is appended to .article
});
}


Check out my fiddle, I don't know how to approach this problem...



How I want it:
Final


More From » html

 Answers
15

You can solve it with CSS , see here: http://jsfiddle.net/sMysu/6/

It is tricky workaround , but it works:



td[valign=top] {
display: block;
}

td[valign=top][style=width: 15%] {
white-space: nowrap;
display: table-cell;
}

[#76880] Thursday, July 18, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
aricl

Total Points: 215
Total Questions: 91
Total Answers: 94

Location: Venezuela
Member since Thu, Jul 15, 2021
3 Years ago
;