![]() |
Help on converting CSV to HTML for Widget
I'm looking to get the printout of this file into the main forum side boxes (widget). I have this code and it seems to work when running in php, but completely screws up the widget box when pasting into the forum manager boxes. Can anyone take a look at it and help me out? Thanks.
Code:
<?php |
1 Attachment(s)
I was able to get this to work, however I had to adjust the sideblock width to 1350 px to accomadate the width of the table. Your code was fine, you just need to return the html to the widget instead of echo.
Code:
ob_start(); |
Thanks. I have this code to drop rows that I do not need, [2], [3],[6]. Which I was able to do in this code, however, I would like to offset each row with a different color (horizontally) and the arrays seem to be populating the table vertically (along with color)... thoughts? Thanks.
For some reason the color for the offset "row" colors is not coming out right in html - when it displays. Its been a while since I've coded, please feel free to give advice or clean up suggestions... thanks. Code:
<?php |
I added a class to the rows and use CSS to color the backgrounds. You could add a class for the TD tags as well and use CSS to set the font and color too.
Code:
<?php |
I was getting help from stack overflow. This looks like it might work, have not tried it yet. The poster indicated that code needs to be changed to get this to work in a widget. What do I need to change in the following code to get it to work, along with where to I place the css file (additional.css)??? Thanks.
Code:
<?php Code:
<style type="text/css"> Quote:
Ok, thanks. That is what someone on stackoverflow did. Could you please let me know what I need to change in the above code to get it to work in the widget? You mentioned something about the object? Also, how do I get the css to work? Thanks again! --------------- Added [DATE]1432184792[/DATE] at [TIME]1432184792[/TIME] --------------- Hey that worked nice!!! How do I get rid of the borders? ALso, what do I need to change in the code to get it to run in a widget? Thanks again! |
Remove the php, body, and html tags, wrap it up in a object like on post 2 and return the object string. Put the CSS in the additional.css or you can write it straight into style tags if you want.
|
Is it possible to add this to the code to get it to scroll? Thanks.
var $table = $('table.scroll'), $bodyCells = $table.find('tbody tr:first').children(), colWidth; // Adjust the width of thead cells when window resizes $(window).resize(function() { // Get the tbody columns width array colWidth = $bodyCells.map(function() { return $(this).width(); }).get(); // Set the width of thead columns $table.find('thead tr').children().each(function(i, v) { $(v).width(colWidth[i]); }); }).resize(); // Trigger resize handler |
That code as-is looks like it will affect all tables on the page. Just looking at it without testing it, it looks like it will work. Add some script tags to it and throw it in an ad block and give it a try. You may have to use the TFtable selector to have the JS only affect the table you're working on.
|
Thanks again! I am trying to add a header at the top, which would remain static, allowing the table to scroll under it. I can't seem to get it to work, and for some reason the header at the top is not the same width as the table below even though both are set to 250 for width...
Code:
<div> |
What you're trying to do with the scrolling feature and fixed header can be done with CSS. There's no reason to bring javascript into the picture for something this simple. Google "CSS table fixed header". You should find tons of examples to go by.
|
All times are GMT. The time now is 02:19 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|