Basically, I'm trying to make a database of collectible cards as a project to get familiar with MySQL and I'm unsure about how to approach setting this up.
Essentially, the database boils down to holding information about individual cards. For example a card will have:
A Name
Some text associated with the card
Color
Also, these cards will belong to sets. A set is a group of cards released in that set. The only information stored about a set is:
The name of the set
The release date of the set
I was approaching this as a many-to-many relationship joined in a joiner table. Since one card can be in several sets and one set can contain multiple cards it made sense.
However, I have a couple problems with this setup.
The first is that information about the card can change with each set, but it is still the same card. For example, the text associated with the card may change but the card is still the same. Instead of having a new card for each set it is in, how would I go about reusing the information that will stay the same and only reflecting the change in text depending on the set? I was thinking about having another table of just card texts which would be linked in the same joiner table. Is this setup possible, and if it is, is it recommended?
Another problem I'm having trouble with is the issue of color. Every card will have a color, but the amount of colors a card may have can vary. For example, a card may be gold, white, and orange and another card may just be green. I would like for this database to allow searches for cards based on their color and for it to output a list of all cards of a color or combinations of color.
To do this, I was thinking that I would have a separate table for each color and implement this as a one-to-many relationship between the cards and colors. Does this make sense?
Thanks in advance and sorry if I sound like an idiot.
It sounds like you're on the right track, but I don't like the idea of creating a separate table for each color. Instead, I recommend doing something like this:
Create a Card table with all of the information that stays the same about the card. Each row should have a unique card ID.
Create a Set table that contains information about the set. Each row should have a unique set ID.
Create a Color table that has a row for each color with each color having a unique color ID.
Create a CardText table that contains the text, the card ID, and the set ID.
Create a CardColor table where each row has a color ID, card ID and set ID.
Related
I am trying to create a unique report and I'm really struggling how I could do it. Here's an image to give an idea:
The report is has a parameter that I pass with a Client ID. I am able to pass multiple Client ID and I am hoping that this generate will display the correct data in a format that I hope to achieve.
let's say I enter ClientID 17,19:
on the first page of Client 17, I want to be able to see content in the red border, below it i will have a tablix and some more stuff. The tablix will have a lot of data and will go to the 2nd page. On the 2nd page, I only want to see the content in the green border.
For next client ID (19), I would again hope to see the content in the red border, and again, if the rest of the report goes to 2nd page, I would want to only see the content in green border.
Anyone have an idea?
I am able to create a report like this for just a single client, as I can make the PAGE HEADER not repeat on each page, and include the Organization: ABC COmpany and ClientName in the Tablix with the rest of the data.
But when it comes to doing multiple clients, I am struggling to make this work.
Put a table in your report that is grouped on your ClientID field. This will initially give you one table row per ClientID.
You can then insert a new row inside the group. This will give you two rows per ClientID.
In the top row, add everything in the red section from your question. You can do this either by adding a sub-table into the textbox that has rows and columns formatted to display the Client's address details, or you can add in a Rectangle to allow free form placement of other report items like text boxes.
In the row below this one, do the same again. Add in everything you would need to display your data as per your green section.
I've used alternate table row shading before (using the ::nth-child selector), but I noticed it can't get the job done when you have irregular table structure. I've come across one specific case for which I'd like to come up with a solution.
In the picture below, you can see that the rows are styled with ::nth-child(even) to give every other row a background color:
The problem here is that in some cases, the first column cell spans two rows, causing the rest of the cells in that "row" (which is really two rows) to appear disjointed or misaligned. The cells in the rows spanned by "Cole" should have the same background color as the first column's cell, because the following columns are all related to the first one. Is this achievable using strictly CSS?
I would just change the structure of the table, but the people entering this content are using a CMS with a built-in text editor, and they have no control over the format. I'd have to manually change every table on their site, which would be a huge undertaking (and it wouldn't account for future tables).
The Problem in Hand:
I want to make a form designer where user can drag and drop fields of different type and design the layout too, some what similar to wufoo form builder but here the layout is limited to single column whereas I want to make something where user can make the layout as they want.
I understand how to do in single column view, but could not understand how to achieve multiple column layout eg: row 1 there could be 3 elements, row 2 one element stretched to full length, row 3 there could be just 2 elements etc.
What I tried:
I have tried with jquery UI sortable to make a single column layout with using div where new elements can be dragged and repositioned.
Any suggestion on how to proceed further will be helpful
I have tried searching StackOverFlow and google but could not find any link on a similar topic. If anyone could point me to the same, it will be also helpful.
When you reorder elements on wufoo form builder, you can only drag'n'drop up or down. Remove that restriction and as soon as one element is dragged across a certain threshold, it "belongs" to the next column. If the "old" column was the first or last one and the line that the element was moved over was to the "outside" of the form, add a new column there, until the maximal number of columns is reached.
If the used drags the last element of a column into another column, remove the now empty column on element-drop.
You could also remove the dynamic adding/removing of columns and juist have a button ("remove column" & "add column") to do it by code.
An example for the dropping in another column can be found here: http://jqueryui.com/sortable/#connect-lists
Hope this helped!
Edit:
http://jqueryui.com/sortable/#portlets and http://jqueryui.com/sortable/#empty-lists also have elements that you could look into. Good luck! Sounds like a nice project. Can we see any progress or beta?
I've got a bit of a challenge with an HTML table that we need to have raised columns. If you look at the attached image you'll see what I mean.
The purpose of these raised columns is to draw the user's attention to them.
The problem is:
To get the effect of the column raising above the other columns you
need some kind of element/height/margin to appear outside the
boundary of the table, which doesn't seem to work
Same goes for the bottom
To have the drop shadow appear correctly, it needs to be applied to all the cells in a column.
We did get this to work by splitting it up into multiple tables then applying the styles to the table that should be the raised column. The image I've attached is actually a live table working like this.
But, you loose all other needed features of tables...
Row heights don't match if the text wraps in table 1 but not in
table 2.
To deal with the row height issue we applied a fixed height to each table's rows, but then you have to force text to not wrap. If you then get text that's longer than the width you run into trouble.
Does anyone know how this can be achieved without splitting the tables?
Thanks,
jacques
Try having an extra row for the table above the header row (you may have to stop using any th tags) to give you the overbar at the top. Similarly for the bottom, an extra highlighting row.
Although you have to compromise the table a little to do that, it is better in my book than separating into 2 tables, as that defeats all the purposes of the table tag; to show a table, and have that table easily declared.
The effects inside the table are probably best done with jquery, unless the choice of highlighted columns is entirely static, in which case consider rendering a static html version by generating the html appropriately.
I am having HTML Tables. There are 10 columns inside that table. I want to Drag and Drop more than one columns. (i.e) select multiple columns and move them around (change column ordering)
Drag and Dropping a single column i know, but how to do this with Multiple Columns...
I am not pretty sure about the code but,
I guess there is one thing that you can try
When the user wants to move the columns then ask him to generate an event like(click on a button or something) now you know when the the particular button is clicked. Now ask the user to select the columns by clicking on them one by one when all the desired columns are selected put them in a single column and ask the user to move it. when the user drops this column on desired location you can remove this column.